package cn.edu.scau.cmi.zhengweibo.client.controller;

import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

import java.io.File;
import java.net.URL;
import java.util.ResourceBundle;

import cn.edu.scau.cmi.zhengweibo.client.AdapterClient;
import cn.edu.scau.cmi.zhengweibo.client.AllFactoryClient;
import cn.edu.scau.cmi.zhengweibo.client.ConsistentCompositeClient1;
import cn.edu.scau.cmi.zhengweibo.client.SafeCompositeClient1;
import cn.edu.scau.cmi.zhengweibo.client.SingletonClient;
import cn.edu.scau.cmi.zhengweibo.client.Spring_HibernateClient;
import javafx.event.ActionEvent;

import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

public class mainViewController implements Initializable{

	@FXML
	private ImageView imageview;
	@FXML
	private Button btn_1;
	@FXML
	private Button btn_2;
	@FXML
	private Button btn_3;
	@FXML
	private Button btn_4;
	@FXML
	private Button btn_5;
	@FXML
	private Button btn_6;
	@FXML
	private Button btn_7;
	@FXML
	private Button btn_8;
	@FXML
	private Button btn_9;
	@FXML
	private Button btn_10;

	@Override
	public void initialize(URL location, ResourceBundle resources) {
		// TODO Auto-generated method stub
		File file = new File("zhengweibo.jpg");
		Image image = new Image(file.toURI().toString());
		imageview.setImage(image);
	}
	
	@FXML
	public void singleton(ActionEvent event) throws Exception {
		new SingletonClient().start(new Stage());
	}
	
	@FXML
	public void multiple(ActionEvent event) throws Exception {
		new SingletonClient().start(new Stage());
	}
	
	@FXML
	public void simpleFactory(ActionEvent event) throws Exception {
		new AllFactoryClient().start(new Stage());
	}
	
	@FXML
	public void factory(ActionEvent event) throws Exception {
		new AllFactoryClient().start(new Stage());
	}
	
	@FXML
	public void abstractFactory(ActionEvent event) throws Exception {
		new AllFactoryClient().start(new Stage());
	}
	
	@FXML
	public void objectAdapter(ActionEvent event) {
		new AdapterClient().start(new Stage());
	}
	
	@FXML
	public void classAdapter(ActionEvent event) {
		new AdapterClient().start(new Stage());
	}
	
	@FXML
	public void safeComposite(ActionEvent event) throws Exception {
		new SafeCompositeClient1().start(new Stage());
	}
	
	@FXML
	public void consistentComposite(ActionEvent event) throws Exception {
		new ConsistentCompositeClient1().start(new Stage());
	}
	
	@FXML
	public void spring_hibernate(ActionEvent event) throws Exception {
		new Spring_HibernateClient().start(new Stage());
	}
}
